﻿$(window).load(function () {

    
    $(".RandomPhotos img").each(function () {
        var a = $(this);
        a[0].width > a[0].height ? a.width(400) : a.height(400);
    })
    
    var currentPhoto = 0, items = $(".RandomPhotos>div");
    var m =items.eq(currentPhoto)
    m.fadeIn();
    
    
    setInterval(function () {
        items.eq(currentPhoto).fadeOut('slow', function () {
            currentPhoto++
          
            items.eq(currentPhoto = currentPhoto < items.length ? currentPhoto : 0).fadeIn();
        })

    }, 2000)

})

